from selenium import webdriver
from selenium.webdriver.common.by import By

driver=webdriver.Chrome()
driver.get('https://www.baidu.com')

# TODO常用的属性
# driver.name浏览器名称
print(driver.name)

# driver.current_url当前网址
print(driver.current_url)

# driver.title当前页面标题
print(driver.title)

# driver.page_source当前页面源码
print(driver.page_source)

# driver.current_window_handle当前窗口句柄
# print(driver.quit())

# driver.window_handles当前打开浏览器的所有标签句柄
print(driver.window_handles)

#TODO 常用方法
# driver.back()浏览器后退
print(driver.back())

# driver.forward()浏览器前进
print(driver.forward())

# driver.refresh()浏览器刷新
print(driver.refresh())

# driver.close()关闭当前窗口
print(driver.close())

# driver.quit()退出浏览器
driver.quit()

